package cc.vicp.djx314.starfood.domain.account;

import java.io.Serializable;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

/**
 * 账号类
 * @author 水山清风
 *
 */
public class Account implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 5176585985287083679L;
	//~属性=====================================================================
	/**
	 * 自增主键
	 */
	private Integer id;
	/**
	 * 用户账号
	 */
	@NotNull
	@Length(min = 3, max = 15, message = "账号必须在3-15个字符之间")
	private String name;
	/**
	 * 用户密码
	 */
	@Length(min = 3, max = 15, message = "密码必须在3-15个字符之间")
	private String password;
	/**
	 * 用户是否被启用（是否是有效的）
	 */
	private Boolean enabled;

	//~构造函数=====================================================================
	public Account() {
		super();
	}
	public Account(String name, String password) {
		super();
		this.name = name;
		this.password = password;
	}

	//~getter和setter=====================================================================
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Boolean getEnabled() {
		return enabled;
	}
	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}
}
